<?php  

/* 

Template Name: Page Contact

*/

?>
<?php get_header();?>
<script type="text/javascript">
   $(document).ready(function(){

	$("#contactform").validate({

   		messages: {

			contactname: "*",

			email: {

				email:"*",

				required: "*",

			},

			email_con: {

				email:"*",

				required: "*",

				equalTo: "*",

			},

			captcha_image : {

				required : "*",

			}

     	},
		rules: {

			email_con: {

				equalTo: "#email",

			}

		}
	});

});
</script>
<div class="cy-content">

    <div class="cy-top-content"></div>

        <!--start slideshow-->
        	<?php locate_template('modules/header/block-slideshow.php', true); ?>
        <!-- end slideshow -->

		<div class="cy-leftpanel">
		   <?php locate_template('modules/left/category01.php', true); ?>  
           <?php locate_template('modules/left/support.php', true); ?>  
		   <?php locate_template('modules/left/company-info.php', true); ?>  
        </div><!-- cy-leftpanel -->

        <div class="cy-rightpanel">
		<?php
		$loop = new WP_Query('page_id=330&posts_per_page=1&orderby=ASC');
				?>
        <?php while ( $loop->have_posts() ) : $loop->the_post(); //bat dau vong lap ?>
            

            <div class="content">
            <h2 class="title"><?php the_title();?></h2>
            <?php the_content();?>
         <?php endwhile; //ket thuc vong lap ?>
        <?php wp_reset_query();?>
    	<form  method="post" action="<?php bloginfo("template_directory"); ?>/sendmail.php" id="contactform" >

      

        <!-- Contact name-->

            <div class="cy-line">

                <label class="cy-line-left" for="contactname">

               <strong>
			   <?php if($_GET['lang']=='vi'){?>
  				 Tên
      			<?php }else{?>
     			 Name
     			 <?php }?></strong>
      		<span style="color:red">*</span></label>

            <div class="cy-r-line">

                <input type="text" size="40" name="contactname" id="contactname" value="" class="required"/>

            </div>

            </div >      

        <!-- Address-->

            <div class="cy-line">

                <label class="cy-line-left" for="address"><strong><?php if($_GET['lang']=='vi'){?>
  				 Địa chỉ
      			<?php }else{?>
     			 Address
     			 <?php }?></strong></label>

            <div class="cy-r-line">

                <input type="text" size="40" name="address" id="address" value=""/>

            </div>

            </div>

		<!-- phonenumber-->

            <div class="cy-line">

                <label class="cy-line-left" for="phonenumber"><strong><?php if($_GET['lang']=='vi'){?>
  				 Điện thoại
      			<?php }else{?>
     			 Phone
     			 <?php }?></strong></label>

            <div class="cy-r-line">

                <input type="text" size="40" name="phonenumber" id="phonenumber" value=""/>

            </div>

            </div>

			

        <!-- Email-->

            <div class="cy-line">

                <label class="cy-line-left" for="email"><strong>Email</strong><span style="color:red">*</span></label>

            <div class="cy-r-line">

                <input type="text" size="40" name="email" id="email" value="" class="required email" />

            </div>

            </div>      

        <!-- Message-->

            <div class="cy-line">

                <label style="height:142px;" class="cy-line-left" for="message"><strong><?php if($_GET['lang']=='vi'){?>
  				 Tin nhắn
      			<?php }else{?>
     			 Note
     			 <?php }?></strong></label>

            <div class="cy-r-line">

                <textarea rows="7" cols="40" name="message" id="message"  style="width: 260px; height:127px; resize:none !important;" ></textarea>

            </div>

            </div>

        <!-- Captcha-->

            <div class="cy-line">

                <label style="height:68px;" class="cy-line-left"  for="message"><strong>Captcha</strong></label>

                <a href='javascript: refreshCaptcha();'>

                <img src="<?php bloginfo("template_directory");?>/captcha_code_file.php?rand=<?php echo rand(); ?>" id='captchaimg' ></a><br />

                <div class="cy-r-line">

               <input style="margin:0px;" size="40" id="captcha_image" name="captcha_image" type="text" class="required captcha_image">

                </div>

            </div>

            

		   <script language='JavaScript' type='text/javascript'>

           function refreshCaptcha()

             {

               var img = document.images['captchaimg'];

               img.src = img.src.substring(0,img.src.lastIndexOf("?"))+"?rand="+Math.random()*1000;

             }

           </script>

                    <div class="cleared"></div>


                    <input class="btn" type="submit" value="Send" name="submit"  src="<?php bloginfo("template_directory");?>/_img/send-button.png" width="77px" height="23px"/>


                    <input class="a" type="hidden" value="rad" />

          </form>

            </div><!-- content -->

            

        </div><!-- cy-rightpanel -->

<?php get_footer(); ?>